package com.alks.function.mapper.stockdept.pcfactorystockquery;

import com.alks.entity.data.entity.PcFinishCollectDetail;
import com.alks.function.data.dto.stockdept.pcfactorystockwork.*;
import com.alks.function.data.request.stockdept.pcfactorystockwork.*;
import com.alks.function.data.vo.stock.InvoicesStockDetailVO;
import com.alks.function.data.vo.stock.InvoicesStockVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * @author: chen
 * @date: 2024/11/12
 * @description: 成品收发详情Mapper
 */
public interface PcFinishCollectDetailMapper extends BaseMapper<PcFinishCollectDetail> {

    /**
     * 成品收发情况分页查询
     * @param request   查询条件
     * @param companyId 公司ID
     * @return
     */
    List<FinishRecTempDto> listQuery(@Param("request") FinishRecTempRequest request, @Param("companyId") String companyId);

    /**
     * 成品收发情况统计
     * @param request
     * @param companyId
     * @return
     */
    Map<String, Object> summaryQuery(@Param("request") FinishRecTempRequest request, @Param("companyId") String companyId);

    /**
     * 成品收发历史分页查询
     * @param request
     * @param companyId
     * @return
     */
    List<FinishRecHisDto> historyQuery(@Param("request") FinishRecHisRequest request, @Param("companyId") String companyId);

    /**
     * 统计当前配码总入库数
     * @param companyId
     * @param lotNo
     * @param groupNo
     * @return
     */
    int sumStoreInByGroupNo(@Param("companyId") String companyId, @Param("lotNo") String lotNo, @Param("groupNo") Integer groupNo);

    /**
     * 统计每个部门线入库情况明细
     * @param request
     * @return
     */
    List<ReportStockInDTO> reportStockIn(@Param("request") ReportStockInQueryRequest request);

    /**
     * 汇总每个部门线入库情况
     * @param request
     * @return
     */
    List<ReportStockInDTO> reportStockInSum(@Param("request") ReportStockInQueryRequest request);

    /**
     * 统计每个客户出库情况明细
     * @param request
     * @return
     */
    List<ReportStockOutDTO> reportStockOut(@Param("request") ReportStockOutQueryRequest request);

    /**
     * 汇总每个客户出库情况
     * @param request
     * @return
     */
    List<ReportStockOutDTO> reportStockOutSum(@Param("request") ReportStockOutQueryRequest request);

    /**
     * 统计每个指令库存情况
     * @param request
     * @return
     */
    List<ReportStockDTO> reportStock(@Param("request") ReportInStockQueryRequest request);

    /**
     * 出入库数据
     * @param startTime
     * @param endTime
     * @return
     */
    List<InvoicesStockDetailVO> invoiceStock(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime,
                                             @Param("collectType") String collectType);
}
